/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.payment;

import com.enation.app.javashop.client.payment.RefundClient;
import com.enation.app.javashop.core.client.fallback.payment.RefundClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 支付中心退款client
 *
 * @author fk
 * @version v7.0
 * @date 20/3/9 下午3:51
 * @since v7.2.1
 */
@FeignClient(name = "payment-service", fallbackFactory = RefundClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface RefundClientFeignImpl  extends RefundClient {

    /**
     * 原路退回
     *
     * @param returnTradeNo 第三方订单号
     * @param refundSn      退款编号，子业务中必须唯一
     * @param refundPrice   退款金额
     * @param subType       子业务类型
     * @return
     */
    @Override
    @RequestMapping(value = "/client/payment/origin-refund",method = RequestMethod.POST)
    Map originRefund(@RequestParam("return_trade_no") String returnTradeNo, @RequestParam("refund_sn") String refundSn, @RequestParam("refund_price")Double refundPrice,@RequestParam("sub_type") String subType);


    /**
     * 查询退款状态
     *
     * @param returnTradeNo 第三方订单号
     * @param refundSn      退款编号，子业务中必须唯一
     * @param subType      子业务类型
     * @return
     */
    @Override
    @RequestMapping(value = "/client/payment/origin-refund/status",method = RequestMethod.GET)
    String queryRefundStatus(@RequestParam("return_trade_no") String returnTradeNo,@RequestParam("refund_sn")  String refundSn, @RequestParam("sub_type") String subType);


}
